<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QtWebApp: httpserver/httprequest.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QtWebApp
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('httprequest_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">httprequest.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="httprequest_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#ifndef HTTPREQUEST_H</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#define HTTPREQUEST_H</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;QByteArray&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;QHostAddress&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;QTcpSocket&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;QMap&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;QMultiMap&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;QSettings&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;QTemporaryFile&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;QUuid&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="httpglobal_8h.html">httpglobal.h</a>&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">namespace </span>stefanfrings {</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classstefanfrings_1_1HttpRequest.html">   38</a></span>&#160;<span class="keyword">class </span>DECLSPEC <a class="code" href="classstefanfrings_1_1HttpRequest.html">HttpRequest</a> {</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    Q_DISABLE_COPY(<a class="code" href="classstefanfrings_1_1HttpRequest.html">HttpRequest</a>)</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classstefanfrings_1_1HttpSessionStore.html">HttpSessionStore</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classstefanfrings_1_1HttpRequest.html#a45b0d7b99dbbb1b2c62afd8f51887995">   45</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="classstefanfrings_1_1HttpRequest.html#a45b0d7b99dbbb1b2c62afd8f51887995">RequestStatus</a> {waitForRequest, waitForHeader, waitForBody, complete, abort};</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <a class="code" href="classstefanfrings_1_1HttpRequest.html">HttpRequest</a>(<span class="keyword">const</span> QSettings* settings);</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classstefanfrings_1_1HttpRequest.html">HttpRequest</a>();</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">void</span> readFromSocket(QTcpSocket *socket);</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    RequestStatus getStatus() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    QByteArray getMethod() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    QByteArray getPath() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keyword">const</span> QByteArray&amp; getRawPath() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    QByteArray getVersion() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    QByteArray getHeader(<span class="keyword">const</span> QByteArray&amp; name) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    QList&lt;QByteArray&gt; getHeaders(<span class="keyword">const</span> QByteArray&amp; name) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    QMultiMap&lt;QByteArray,QByteArray&gt; getHeaderMap() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    QByteArray getParameter(<span class="keyword">const</span> QByteArray&amp; name) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    QList&lt;QByteArray&gt; getParameters(<span class="keyword">const</span> QByteArray&amp; name) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    QMultiMap&lt;QByteArray,QByteArray&gt; getParameterMap() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    QByteArray getBody() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">static</span> QByteArray urlDecode(<span class="keyword">const</span> QByteArray source);</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160; </div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    QTemporaryFile* getUploadedFile(<span class="keyword">const</span> QByteArray fieldName) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    QByteArray getCookie(<span class="keyword">const</span> QByteArray&amp; name) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    QMap&lt;QByteArray,QByteArray&gt;&amp; getCookieMap();</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    QHostAddress getPeerAddress() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160; </div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    QMultiMap&lt;QByteArray,QByteArray&gt; headers;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160; </div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    QMultiMap&lt;QByteArray,QByteArray&gt; parameters;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160; </div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    QMap&lt;QByteArray,QTemporaryFile*&gt; uploadedFiles;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    QMap&lt;QByteArray,QByteArray&gt; cookies;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160; </div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    QByteArray bodyData;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    QByteArray method;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    QByteArray path;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    QByteArray version;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    RequestStatus status;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    QHostAddress peerAddress;</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordtype">int</span> maxSize;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160; </div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordtype">int</span> maxMultiPartSize;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="keywordtype">int</span> currentSize;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="keywordtype">int</span> expectedBodySize;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    QByteArray currentHeader;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    QByteArray boundary;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    QTemporaryFile* tempFile;</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160; </div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keywordtype">void</span> parseMultiPartFile();</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160; </div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="keywordtype">void</span> readRequest(QTcpSocket* socket);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160; </div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordtype">void</span> readHeader(QTcpSocket* socket);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keywordtype">void</span> readBody(QTcpSocket* socket);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="keywordtype">void</span> decodeRequestParams();</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <span class="keywordtype">void</span> extractCookies();</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    QByteArray lineBuffer;</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;};</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;} <span class="comment">// end of namespace</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// HTTPREQUEST_H</span></div>
<div class="ttc" id="aclassstefanfrings_1_1HttpRequest_html"><div class="ttname"><a href="classstefanfrings_1_1HttpRequest.html">stefanfrings::HttpRequest</a></div><div class="ttdoc">This object represents a single HTTP request.</div><div class="ttdef"><b>Definition:</b> <a href="httprequest_8h_source.html#l00038">httprequest.h:38</a></div></div>
<div class="ttc" id="aclassstefanfrings_1_1HttpRequest_html_a45b0d7b99dbbb1b2c62afd8f51887995"><div class="ttname"><a href="classstefanfrings_1_1HttpRequest.html#a45b0d7b99dbbb1b2c62afd8f51887995">stefanfrings::HttpRequest::RequestStatus</a></div><div class="ttdeci">RequestStatus</div><div class="ttdoc">Values for getStatus()</div><div class="ttdef"><b>Definition:</b> <a href="httprequest_8h_source.html#l00045">httprequest.h:45</a></div></div>
<div class="ttc" id="aclassstefanfrings_1_1HttpSessionStore_html"><div class="ttname"><a href="classstefanfrings_1_1HttpSessionStore.html">stefanfrings::HttpSessionStore</a></div><div class="ttdoc">Stores HTTP sessions and deletes them when they have expired.</div><div class="ttdef"><b>Definition:</b> <a href="httpsessionstore_8h_source.html#l00035">httpsessionstore.h:35</a></div></div>
<div class="ttc" id="ahttpglobal_8h_html"><div class="ttname"><a href="httpglobal_8h.html">httpglobal.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_32a529a3b2babe504aaf73e401f143d0.html">httpserver</a></li><li class="navelem"><a class="el" href="httprequest_8h.html">httprequest.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
